import logging

from flask import current_app
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
from flask import session
from info import create_app, db, models


app = create_app("development")
# Flask_Script
manager = Manager(app)
# 数据库迁移操作
Migrate(app, db)
manager.add_command('db', MigrateCommand)



if __name__ == "__main__":
    # session["name"] = "itheima"
    print(app.url_map)
    # 测试打印日志
    # logging.debug('测试debug')
    # logging.warning('测试warning')
    # logging.error('测试error')
    # logging.fatal('测试fatal')

    # current_app.logger.error("测试error")
    manager.run()
